package com.hou.springmq.mq.consumer.topic;

import org.springframework.stereotype.Component;

import javax.jms.Message;
import javax.jms.MessageListener;

//实现MessageListener消息监听器,实际中肯定不可能主动去接受消息,所以一般是用监听器
@Component
public class TopicReceiver01 implements MessageListener {
    @Override
    public void onMessage(Message message) {
        System.out.println("1号消费者接受到订阅的消息:"+message.toString());
    }
}
